package entity

import (
	"shqsoft.cn/pasnj/base"
)

//BasePara FTP曲线
type CONF_INFO struct {
	ID          int    `gorm:"AUTO_INCREMENT;primary_key;column:ID"`
	NAME        string `gorm:"column:NAME"`
	ISQY        int    `gorm:"column:ISQY"`
	ISQYCaption string `gorm:"-"`
}

//TableName FTP曲线表名
func (CONF_INFO) TableName() string {
	return "T_CONF_INFO"
}

// AfterFind 选择男女
func (u *CONF_INFO) AfterFind() (err error) {

	if u.ISQY == 1 {
		u.ISQYCaption = "启用"
	} else {
		u.ISQYCaption = "禁用"
	}
	return
}

//CONF_INFOEF 一个结构
func CONF_INFOEF() base.EntityFunc {
	return func() interface{} {
		entity := CONF_INFO{}
		return &entity
	}
}

//CONF_INFOESF 数组结构体
func CONF_INFOESF() base.EntitiesFunc {
	return func() interface{} {
		var entities []CONF_INFO
		return &entities
	}
}

func init() {
	base.DaoPoolObj.Put("CONF_INFO", base.NewDefaultDao(CONF_INFOEF(), CONF_INFOESF(), nil))
}
